home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware City / Developers / NeoPersist 3.0.8 folder / NeoBench / Source / CNeoWindow.cp < prev    next >
Encoding:
Text File  |  1994-10-18  |  17.5 KB  |  627 lines  |  [TEXT/MMCC]

  1. /**********************************************************************
  2.   CNeoWindow.cp
  3.  
  4.   This window behaves differently than CWindow when it is Zoomed.
  5.   It is supposed to move to the center of the screen when the Zoom
  6.   button is pressed. So no matter where it is,  it will always
  7.   center when Zoom is pressed.
  8.  
  9.   The "Direction" argument to Zoom is meaningless and is ignored.
  10. **********************************************************************/
  11.  
  12. #include "NeoTypes.h"
  13. #include "CNeoWindow.h"
  14. #include CNeoDocNativeH
  15. #include CNeoDatabaseNativeH
  16. #include CNeoPersistNativeH
  17. #include CNeoMetaClassH
  18. #include CNeoIndexIteratorH
  19. #include "CRawText.h"
  20. #include <stdlib.h>
  21. #include <Timer.h>
  22. #include <Fonts.h>
  23. #include <UDrawingState.h>
  24. #include "LEditField.h"
  25. #include "LButton.h"
  26. #include "CFiller.h"
  27.  
  28. long gLoopOverhead;    // Timer Manager Overhead
  29.  
  30. CNeoWindow::CNeoWindow(const ResIDT aResID, CNeoDocPP *aDocument)
  31.     : LWindow(aResID, windAttr_Regular + windAttr_Enabled + windAttr_Targetable, aDocument)
  32. {
  33.     short    height;
  34.     short    index, j;
  35.     short   hpos;
  36.     short    vpos;
  37.     long    value;
  38.     Point    pt;
  39.     Rect    bounds;
  40.     Rect    rect;
  41.  
  42.     fIterator = nil;
  43.     fObject = nil;
  44.  
  45.     /**
  46.      ** Set the Min and Max value the window can be resized.
  47.      **  Note that we really don't want the user to resize it
  48.      **  so we make the min and max numbers the same.
  49.      **/
  50.     SetRect(&bounds, 0, 0, 390, 200);
  51.     pt.h = (qd.screenBits.bounds.right - (bounds.right - bounds.left)) / 2;
  52.     pt.v = (qd.screenBits.bounds.bottom - (bounds.bottom - bounds.top)) / 3;
  53.     height = GetMBarHeight() + 1;
  54.     pt.v = (pt.v > height ? pt.v : height);
  55.     rect.top = pt.v;
  56.     rect.bottom = bounds.bottom + (pt.v - bounds.top);
  57.     rect.left = pt.h;
  58.     rect.right = bounds.right + (pt.h - bounds.left);
  59.     DoSetBounds(rect);
  60.  
  61.     // -----------------------------------------------------------
  62.     // Set the thread counts for each phase
  63.     // -----------------------------------------------------------
  64.  
  65.     for (index = kMinPhase; index <= kMaxPhase; index++) {
  66.         fPhaseInfo[index].dirty = FALSE;
  67.     }
  68.  
  69.     // -----------------------------------------------------------
  70.     // Make the Stat Text Phase names going down
  71.     // -----------------------------------------------------------
  72.     vpos = V_TOTAL +2;
  73.  
  74.     for (index = kMinPhase; index <= kMaxPhase; index++) {
  75.         NeoPhaseNames[index] = new CRawText(this, PhaseNames[index], LEFT_STAT, vpos, PHASE_NAME_WID, STAT_HGT);
  76.         NeoPhaseNames[index]->SetTextTraitsID(NeoLeftStyleID);
  77.         vpos += V_DIST;
  78.     }
  79.  
  80.     // -----------------------------------------------------------
  81.     // Make the object size static text item.
  82.     // -----------------------------------------------------------
  83.  
  84.     vpos += 14;
  85.     fSizeStatic = new CRawText(this, "\pObject Size:", LEFT_STAT +25, vpos, PHASE_NAME_WID, STAT_HGT);
  86.     fSizeStatic->SetTextTraitsID(NeoRightStyleID);
  87.  
  88.     // -----------------------------------------------------------
  89.     // Make the Editable Text boxes going down
  90.     // -----------------------------------------------------------
  91.     vpos = V_TOTAL;
  92.  
  93.     for (index = kMinPhase; index <= kMaxPhase; index++) {
  94.         NeoEditTexts[index] = new LEditField();
  95.         NeoEditTexts[index]->SetTextTraitsID(NeoTextStyleID);
  96.         NeoEditTexts[index]->SetKeyFilter((KeyFilterFunc)UKeyFilters::IntegerField);
  97.         NeoEditTexts[index]->Enable();
  98.         NeoEditTexts[index]->SelectAll();
  99.         NeoEditTexts[index]->PutInside(this);
  100.         NeoEditTexts[index]->SetDescriptor(Txts);
  101.         NeoEditTexts[index]->ResizeFrameTo(TOT_WID, TOT_HGT, FALSE);
  102.         NeoEditTexts[index]->PlaceInSuperImageAt(H_TOTAL, vpos, FALSE);
  103.         NeoEditTexts[index]->SetSuperCommander(this);
  104.         value = default_vals[index];
  105.         NeoEditTexts[index]->SetValue(value);
  106.         vpos += V_DIST;
  107.     }
  108.     NeoEditTexts[kMinPhase]->Activate();
  109.  
  110.     // -----------------------------------------------------------
  111.     // Make the object size static text items.
  112.     // -----------------------------------------------------------
  113.  
  114.     vpos += 14;
  115.     fSizeText = new LEditField();
  116.     fSizeText->SetTextTraitsID(NeoTextStyleID);
  117.     fSizeText->SetKeyFilter((KeyFilterFunc)UKeyFilters::IntegerField);
  118.     fSizeText->Enable();
  119.     fSizeText->SelectAll();
  120.     fSizeText->PutInside(this);
  121.     fSizeText->SetDescriptor(Txts);
  122.     fSizeText->ResizeFrameTo(SIZE_WID, TOT_HGT, FALSE);
  123.     fSizeText->PlaceInSuperImageAt(H_TOTAL +75, vpos, FALSE);
  124.     fSizeText->SetSuperCommander(this);
  125.     value = CFiller::GetLength();
  126.     fSizeText->SetValue(value);
  127.  
  128.     // -----------------------------------------------------------
  129.     // Make the Stat Text boxes going down and across
  130.     // -----------------------------------------------------------
  131.     vpos = V_STAT_START;
  132.  
  133.     for (index = kMinPhase; index <= kMaxPhase; index++) {
  134.         hpos = H_STAT_START;
  135.         for (j = kSoFar; j <= kMaxCol; j++) {
  136.             switch (j) {
  137.             case kSoFar:
  138.             case kPerObject:
  139.                 NeoRawTexts[index][j] = new CRawText(this, Txts, hpos, vpos, STAT_WID, STAT_HGT);
  140.                 break;
  141.  
  142.             case kTotal:
  143.                 NeoRawTexts[index][j] = new CTimeText(this, Txts, hpos, vpos, STAT_WID, STAT_HGT);
  144.                 break;
  145.             }
  146.             NeoRawTexts[index][j]->SetTextTraitsID(NeoRightStyleID);
  147.             hpos += H_DIST;
  148.         }
  149.         vpos += V_DIST;
  150.     }
  151.  
  152.     // -----------------------------------------------------------
  153.     // Create the Go button and disable it.
  154.     // -----------------------------------------------------------
  155.     NeoGoButton = new LButton();
  156.     NeoGoButton->PutInside(this);
  157.     NeoGoButton->SetGraphics(GO_RES_ID, GO_RES_ID +1);
  158.     NeoGoButton->PlaceInSuperImageAt(GO_LFT, GO_TOP, FALSE);
  159.     NeoGoButton->ResizeFrameTo(GO_WID, GO_HGT, FALSE);
  160.     NeoGoButton->SetValueMessage(cmdGO);
  161.     NeoGoButton->Show();
  162.     NeoGoButton->Activate();
  163.     NeoGoButton->Enable();
  164.     NeoGoButton->AddListener(this);
  165.  
  166.     // -----------------------------------------------------------
  167.     // Create the Stop button,  and disable it.
  168.     // -----------------------------------------------------------
  169.     NeoStopButton = new LButton();
  170.     NeoStopButton->PutInside(this);
  171.     NeoStopButton->SetGraphics(STOP_RES_ID, STOP_RES_ID +1);
  172.     NeoStopButton->PlaceInSuperImageAt(STOP_LFT, STOP_TOP, FALSE);
  173.     NeoStopButton->ResizeFrameTo(STOP_WID, STOP_HGT, FALSE);
  174.     NeoStopButton->SetValueMessage(cmdSTOP);
  175.     NeoStopButton->Show();
  176.     NeoStopButton->Activate();
  177.     NeoStopButton->Disable();
  178.     NeoStopButton->AddListener(this);
  179.  
  180.     //------------------------------------------------------------
  181.     // Now put in the default max value
  182.     //------------------------------------------------------------
  183.     for (index = kMinPhase; index <= kMaxPhase; index++) {
  184.         maxValue[index] = default_maxs[index];
  185.         minValue[index] = 0;
  186.     }
  187.  
  188.     ClearStatPanes();
  189.  
  190.     /**
  191.      ** Set the button state flag
  192.      **/
  193.     fState = kStop;
  194.  
  195.     fPhase = kNoPhase;            /* No phase yet    */
  196.  
  197.     // These three values are the running values that change
  198.     col_index = kMinCol;
  199.     for (index = kMinCol; index <= kMinCol; index++)
  200.         col_value[index] = 0;
  201.  
  202.     //
  203.     // Init the fields in the array.  The default values
  204.     // will be coming from the text in the TextEdit boxes.
  205.     //
  206.     for (index = kMinPhase; index <= kMaxPhase; index++) {
  207.         fPhaseInfo[index].target = 0;
  208.         fPhaseInfo[index].done = 0;
  209.         fPhaseInfo[index].committed = 0;
  210.         fPhaseInfo[index].soFar = 0;
  211.     }
  212.  
  213.     srand((unsigned int)clock());
  214.  
  215.     Enable();
  216.     Select();
  217.     Show();
  218.  
  219.     NeoStopButton->Disable();
  220.     NeoGoButton->Disable();
  221.     NeoGoButton->Enable();
  222. }
  223.  
  224. /***
  225.  * DrawSelf
  226.  *
  227.  *    In this method, you draw whatever you need to display in
  228.  *    your pane. The area parameter gives the portion of the
  229.  *    pane that needs to be redrawn. Area is in frame coordinates.
  230.  *
  231.  ***/
  232.  
  233. void CNeoWindow::DrawSelf(void)
  234. {
  235.     Rect        rect;
  236.     Rect        frame;
  237.     PicHandle    pict;
  238.  
  239.     CalcLocalFrameRect(frame);
  240.     StColorPenState::Normalize();
  241.  
  242.     pict = ::GetPicture(kTitlePICTID);
  243.     NeoFailNil(pict);
  244.     rect = (*pict)->picFrame;
  245.     ::OffsetRect(&rect, -rect.left, -rect.top);
  246.     ::OffsetRect(&rect, H_TOTAL, 15);
  247.     ::DrawPicture(pict, &rect);
  248. }
  249.  
  250. /********************************************************************
  251.   For a particular index,   get the total number converted from the
  252.   TextBox string,  and compare it with the limits,  and if out of
  253.   limits,  adjust them to be back within the given limits.
  254. ********************************************************************/
  255. long    CNeoWindow::GetTotalNum(short index)
  256. {
  257.     long    value;
  258.  
  259.     if (index < kMinPhase || index > kMaxPhase)
  260.         return 0;
  261.  
  262.     value = NeoEditTexts[index]->GetValue();
  263.     if (value > maxValue[index]) {
  264.         NeoEditTexts[index]->SetValue(maxValue[index]);
  265.         value = maxValue[index];
  266.     }
  267.     if (value < minValue[index]) {
  268.         NeoEditTexts[index]->SetValue(minValue[index]);
  269.         value = minValue[index];
  270.  
  271.     }
  272.     return(value);
  273. }
  274.  
  275. /*******************************************************************
  276.   ClearStatPanes - Clears out the Stat text panes containing the
  277.   numbers calculated from the run.   Sets the numbers to Zero
  278.   in preparation for the run.
  279. *******************************************************************/
  280. void    CNeoWindow::ClearStatPanes(void)
  281. {
  282.     short    row;
  283.     short    column;
  284.  
  285.     for (row = kMinPhase; row <= kMaxPhase; row++)
  286.         for (column = kSoFar; column <= kMaxCol; column++) {
  287.             NeoRawTexts[row][column]->SetValue(0);
  288.             NeoRawTexts[row][column]->Refresh();
  289.         }
  290. }
  291.  
  292. /*******************************************************************
  293.   UpdateCol - Given an index into the phase array ( 0 - 4),  and
  294.   an index into the row (0 - 2),  we put the value into the
  295.   static text area of the dialog box.
  296. *******************************************************************/
  297. void CNeoWindow::UpdateCol(short aPhase, short aRow, long aValue)
  298. {
  299.     // Do error bounds checking,  because it spits and sparksten
  300.     // if these arrays are out of bounds.
  301.  
  302.     if (aPhase > kMaxPhase || aPhase < kMinPhase || aRow > kMaxCol || aRow < kMinCol)
  303.         return;
  304.  
  305.     NeoRawTexts[aPhase][aRow]->SetValue(aValue);
  306.     NeoRawTexts[aPhase][aRow]->Refresh();
  307. }
  308.  
  309.  
  310. short CNeoWindow::getPhase(void) const
  311. {
  312.     return fPhase;
  313. }
  314.  
  315. long CNeoWindow::getPhaseTarget(const short aPhase) const
  316. {
  317.     return fPhaseInfo[aPhase].target;
  318. }
  319.  
  320. Boolean CNeoWindow::getState(void) const
  321. {
  322.     return fState;
  323. }
  324.  
  325. #define CR 0x24
  326. /*******************************************************************
  327.  
  328. *******************************************************************/
  329. Boolean CNeoWindow::HandleKeyPress(const EventRecord &aEvent)
  330. {
  331.     Boolean        handled;
  332.  
  333.     if ((aEvent.message&charCodeMask) == CR) {
  334.         if (fState == kStop)
  335.             ListenToMessage(cmdGO, nil);
  336.         else
  337.             ListenToMessage(cmdSTOP, nil);
  338.         handled = TRUE;
  339.     }
  340.     else
  341.         handled = LCommander::HandleKeyPress(aEvent);
  342.  
  343.     return handled;
  344. }
  345.  
  346. void CNeoWindow::ListenToMessage(MessageT aMessage, void *aParam)
  347. {
  348.     switch (aMessage) {
  349.     case cmdGO:
  350.         setState(kStart);
  351.         break;
  352.  
  353.     case cmdSTOP:
  354.         setState(kStop);
  355.         break;
  356.     }
  357. }
  358.  
  359. void CNeoWindow::setDocument(CNeoDocPP *aDocument)
  360. {
  361.     CNeoDatabasePP *    database;
  362.  
  363.     database = aDocument->getDatabase();
  364.  
  365.     if (database)
  366.         checkFileState();
  367. }
  368.  
  369. void CNeoWindow::checkFileState(void)
  370. {
  371.     long            tryFor;
  372.     long            actual;
  373.     CNeoDocPP *        document    = (CNeoDocPP *)GetSuperCommander();
  374.     CNeoDatabase *    database    = document->getDatabase();
  375.  
  376.     fPhaseInfo[kInsert].delta = database->getObjectCount(kFillerID, FALSE);
  377.     if (fPhaseInfo[kInsert].delta) {
  378.         UpdateCol(kInsert, kSoFar, fPhaseInfo[kInsert].delta);
  379.         tryFor = database->getVersion();
  380.         actual = CFiller::SetLength(tryFor);
  381.         NeoAssert(actual < tryFor);
  382.         fSizeText->SetValue(actual);
  383.     }
  384.     else {
  385.         tryFor = fSizeText->GetValue();
  386.         actual = CFiller::SetLength(tryFor);
  387.         database->setVersion(actual);
  388.         if (actual != tryFor)
  389.             fSizeText->SetValue(actual);
  390.     }
  391. }
  392.  
  393. void CNeoWindow::setPhase(const short aPhase)
  394. {
  395.     fPhase = aPhase;
  396. }
  397.  
  398. void CNeoWindow::setState(const Boolean aState)
  399. {
  400.     short    index;
  401.     short    phase;
  402.  
  403.     if (aState == kStop) {
  404.         StopIdling();
  405.         phase = kNoPhase;
  406.         NeoStopButton->Disable();
  407.         NeoGoButton->Enable();
  408.     }
  409.     else {
  410.         for (index = kMinPhase;  index <= kMaxPhase; index++) {
  411.             fPhaseInfo[index].target = GetTotalNum(index);
  412.             fPhaseInfo[index].done = 0;
  413.             fPhaseInfo[index].committed = 0;
  414.             fPhaseInfo[index].delta = 0;
  415.             fPhaseInfo[index].soFar = 0;
  416.         }
  417.  
  418.         checkFileState();
  419.  
  420.         if (fPhaseInfo[kInsert].delta < fPhaseInfo[kInsert].target)
  421.             phase = kMinPhase;
  422.         else
  423.             phase = kRandomly;
  424.  
  425.         StartIdling();
  426.         NeoGoButton->Disable();
  427.         NeoStopButton->Enable();
  428.     }
  429.     NeoGoButton->Refresh();
  430.     NeoStopButton->Refresh();
  431.  
  432.     fState = aState;
  433.  
  434.     setPhase(phase);
  435. }
  436.  
  437. /******************************************************************************
  438.  SpendTime
  439.  ******************************************************************************/
  440. void CNeoWindow::SpendTime(const EventRecord & /* aEvent */)
  441. {
  442.     short            index;
  443.     CNeoDocPP *        document                    = (CNeoDocPP *)GetSuperCommander();
  444.     CNeoDatabase *    database                    = document->getDatabase();
  445.     TMTask            timer;
  446.  
  447.     doSomeWork(fPhase, &timer);
  448.  
  449.     for (index = kMinPhase; index <= kMaxPhase; index++)
  450.         if (fPhaseInfo[index].dirty) {
  451.             UpdateCol(index, kSoFar, fPhaseInfo[index].delta + fPhaseInfo[index].committed);
  452.             UpdateCol(index, kPerObject, ((double)fPhaseInfo[index].committed / (double)(fPhaseInfo[index].soFar ? fPhaseInfo[index].soFar : 1)) * 1000000);
  453.             UpdateCol(index, kTotal, fPhaseInfo[index].soFar);
  454.             fPhaseInfo[index].dirty = FALSE;
  455.         }
  456.  
  457.     if (fPhase > kMaxPhase)
  458.         setState(kStop);
  459.  
  460.     if (fPhase == kNoPhase &&
  461.         database->isOpen()) {
  462.         database->commit(TRUE);
  463.         document->setDirty(FALSE);
  464.     }
  465. }
  466.  
  467. /******************************************************************************
  468.  doSomeWork
  469.  ******************************************************************************/
  470. void CNeoWindow::doSomeWork(const short aPhase, TMTask *aTimer)
  471. {
  472.     long            done;
  473.     long            IveDone        = 0;
  474.     long            delta;
  475.     long            quantum;
  476.     NeoID            id;
  477.     CNeoPersist *    object;
  478.     CNeoDatabase *    oldDatabase    = gNeoDatabase;
  479.     CNeoDocPP *        document    = (CNeoDocPP *)GetSuperCommander();
  480.     CNeoDatabase *    database    = document->getDatabase();
  481.     TMTask            updateTask;
  482.  
  483.     quantum = 500;
  484.     if (fPhaseInfo[aPhase].delta + fPhaseInfo[aPhase].done < fPhaseInfo[aPhase].target) {
  485.         gNeoDatabase = database;
  486.  
  487.         updateTask.tmAddr = nil;
  488.         updateTask.qType = 0;
  489.         updateTask.tmCount = 0;
  490.         updateTask.tmWakeUp = 0;
  491.         updateTask.tmReserved = 0;
  492.         InsXTime((QElem *)&updateTask);
  493.         PrimeTime((QElem *)&updateTask, quantum);
  494.  
  495.         aTimer->tmAddr = nil;
  496.         aTimer->qType = 0;
  497.         aTimer->tmCount = 0;
  498.         aTimer->tmWakeUp = 0;
  499.         aTimer->tmReserved = 0;
  500.         InsXTime((QElem *)aTimer);
  501.         PrimeTime((QElem *)aTimer, k30MicroMinutes);
  502.     
  503.         while ((updateTask.qType&0x8000) &&
  504.                (fPhaseInfo[aPhase].delta + fPhaseInfo[aPhase].done < fPhaseInfo[aPhase].target)) {
  505.     
  506.             fPhaseInfo[aPhase].done++;
  507.             IveDone++;
  508.  
  509.             switch (aPhase) {
  510.             case    kInsert:
  511.                 /*------------------------------------------------------*/
  512.                 /* Perform the code for record insertion sequence         */
  513.                 /*------------------------------------------------------*/
  514.                 object = new CFiller;
  515.                 FailNIL(object);
  516.                 delta = fPhaseInfo[kInsert].delta;
  517.                 done = fPhaseInfo[kInsert].done;
  518.                 object->fID = delta + done;
  519.                 database->addObject(object);
  520.                 document->setDirty();
  521.                 object->unrefer();
  522.                 break;
  523.  
  524.             case    kRandomly:
  525.                 /*------------------------------------------------------*/
  526.                 /* Perform the code for randomly searching sequence     */
  527.                 /*------------------------------------------------------*/
  528.                 id = (rand()&0x7FFFFFFF) % fPhaseInfo[kInsert].target;
  529.                 if (!id)
  530.                     id = fPhaseInfo[kInsert].target / 2;
  531.                 fObject = (CFiller *)CFiller::FindByID(database, kFillerID, id, FALSE, nil, nil);
  532.                 NeoAssert(fObject);
  533.                 fObject->unrefer();
  534.                 fObject = nil;
  535.                 break;
  536.  
  537.             case    kSerially:
  538.                 /*------------------------------------------------------*/
  539.                 /* Perform the code for Serially searching sequence        */
  540.                 /*------------------------------------------------------*/
  541.                 if (fIterator) {
  542.                     object = fIterator->nextObject();
  543.                     if (!object) {
  544.                         fIterator->reset();
  545.                         object = fIterator->currentObject();
  546.                     }
  547.                 }
  548.                 else {
  549.                     fIterator = new CNeoIndexIterator(database, kFillerID, nil, FALSE, FALSE);
  550.                     object = fIterator->currentObject();
  551.                 }
  552.                 NeoAssert(object);
  553.                 break;
  554.  
  555.             case    kChange:
  556.                 /*------------------------------------------------------*/
  557.                 /* Perform the code for Change sequence here            */
  558.                 /*------------------------------------------------------*/
  559.                 if (fIterator) {
  560.                     object = fIterator->nextObject();
  561.                     if (!object) {
  562.                         fIterator->reset();
  563.                         object = fIterator->currentObject();
  564.                     }
  565.                 }
  566.                 else {
  567.                     fIterator = new CNeoIndexIterator(database, kFillerID);
  568.                     object = fIterator->currentObject();
  569.                 }
  570.                 NeoAssert(object);
  571.                 object->autoReferTo();
  572.                 object->setDirty();
  573.                 object->autoUnrefer();
  574.                 document->setDirty();
  575.                 break;
  576.  
  577.             case    kDelete:
  578.                 /*------------------------------------------------------*/
  579.                 /* Perform the code for Delete sequencing here            */
  580.                 /*------------------------------------------------------*/
  581.                 if (!fIterator)
  582.                     fIterator = new CNeoIndexIterator(database, kFillerID);
  583.                 object = fIterator->currentObject();
  584. //                if (!object) {
  585. //                    fIterator->reset();
  586. //                    object = fIterator->currentObject();
  587. //                }
  588.                 NeoAssert(object);
  589.                 object->autoReferTo();
  590.                 fIterator->removeCurrent();
  591.                 object->autoUnrefer();
  592.                 break;
  593.             }
  594.         }
  595.  
  596.         if (database->isOpen() &&
  597.             document->isDirty() &&
  598.             CNeoPersist::FCacheUsed > (CNeoPersist::FCacheSize>>1)) {
  599.             if (aPhase == kDelete &&
  600.                 fPhaseInfo[aPhase].delta + fPhaseInfo[aPhase].done >= fPhaseInfo[aPhase].target)
  601.                 database->commit(TRUE);
  602.             else
  603.                 database->commit(FALSE);
  604.             document->setDirty(FALSE);
  605.         }
  606.  
  607.         RmvTime((QElem *)aTimer);
  608.         RmvTime((QElem *)&updateTask);
  609.  
  610.         if (aTimer->tmCount > 0)
  611.             fPhaseInfo[aPhase].soFar += -(k30MicroMinutes + aTimer->tmCount * 1000) - gLoopOverhead;
  612.         else
  613.             fPhaseInfo[aPhase].soFar += -(k30MicroMinutes - aTimer->tmCount) - gLoopOverhead;
  614.         fPhaseInfo[aPhase].committed += IveDone;
  615.         fPhaseInfo[aPhase].dirty = TRUE;
  616.  
  617.         gNeoDatabase = oldDatabase;
  618.     }
  619.     else
  620.         setPhase(aPhase +1);
  621. }
  622.  
  623. void CNeoWindow::ClickInZoom(const EventRecord& inMacEvent, short inZoomDirection)    // Zoom can be in or out
  624. {
  625.     // Don't allow zooming
  626. }
  627.